<?php

//路由分发
class View {
    public $vars = array();
    public function assign($data, $value = '') {
        if(is_array($data)){
            $this->vars = array_merge($this->vars,$data);
        }else{
            $this->vars[$data] = $value;
        }
    }

    public function display($template = '', $ext = '.php') {
        extract($this->vars);
        include 'views/' . $template . $ext;
    }

}
